
function catalog_redio_click() {
    table.on('radio(CatalogList)', function(obj){
        console.log(obj.checked); //当前是否选中状态
        console.log(obj.data); //选中行的相关数据
        var item=obj.data;
        $("#delCatalogID").val(item.Id);
        $("#ModifyCatalogID").val(item.Id);
        $("#delCatalogName").val(item.Name);
        $("#ModifyCatalogName").val(item.Name);
        $("#delCatalogContent").val(item.Content);
        $("#ModifyCatalogContent").val(item.Content);
    });
}
function DelCatalog() {
    var catalog_id=$("#delCatalogID").val();
    console.log(catalog_id);
    if(NotEmpty(catalog_id)){
        Popup.msg("分类ID不能为空",{icon:5});
        return;
    }
    Popup.confirm('确认删除吗？',{btn: ['是','否']},function () {
        $.post("/CenterInc/view_inc/admin/Admin_Catalog_inc.aspx",{mode:1,catalog_id:catalog_id},function (data) {
            if(data["error"]!=undefined){
                Popup.msg(data["error"],{icon:5});
                return;
            }
            Popup.msg(data["msg"],{icon:1});
            setTimeout("window.location.reload()",2000);
            return;
        });
    });

}

function AddCatalog() {
    var catalog_name=$("#AddCatalogName").val();
    var catalog_content=$("#AddCatalogContent").val();
    if(NotEmpty(catalog_name,catalog_content)){
        Popup.msg("名称和说明不能为空哦",{icon:5});
        return;
    }
    Popup.confirm('确认添加吗？',{btn: ['是','否']},function () {
        $.post("/CenterInc/view_inc/admin/Admin_Catalog_inc.aspx",{mode:2,catalog_name:catalog_name,catalog_content:catalog_content},function (data) {
            if(data["error"]!=undefined){
                Popup.msg(data["error"],{icon:5});
                return;
            }
            Popup.msg(data["msg"],{icon:1});
            setTimeout("window.location.reload()",2000);
            return;
        });
    });
}

function ModifyCatalog() {
    var catalog_id=$("#ModifyCatalogID").val();
    var catalog_name=$("#ModifyCatalogName").val();
    var catalog_content=$("#ModifyCatalogContent").val();
    if(NotEmpty(catalog_id,catalog_name,catalog_content)){
        Popup.msg("名称和说明不能为空哦",{icon:5});
        return;
    }
    Popup.confirm('确认添加吗？',{btn: ['是','否']},function () {
        $.post("/CenterInc/view_inc/admin/Admin_Catalog_inc.aspx",{mode:3,catalog_id:catalog_id,catalog_name:catalog_name,catalog_content:catalog_content},function (data) {
            if(data["error"]!=undefined){
                Popup.msg(data["error"],{icon:5});
                return;
            }
            Popup.msg(data["msg"],{icon:1});
            setTimeout("window.location.reload()",2000);
            return;
        });
    });
}